<%
    if (session.getAttribute("userid") == null || !session.getAttribute("tipo_utente").toString().equals("1")) {
        session.invalidate();
        getServletContext().getRequestDispatcher("/MainController?q=index").forward(request, response);
    }

    String idlocale = request.getAttribute("idlocale").toString();
%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tlds/asportoonline.tld" prefix="asportoonline" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>JSP Page</title>
        <style type="text/css">
            @import url("style.css");
        </style>
    </head>
    <body>
        <div class="meister">
            <div class="page">
                <div class="container">
                    <%@ include file="/WEB-INF/common/header.jsp"%>
                    <div class="navigation"> <a href="MainController?q=index">Home</a> </div>

                    <h1>Registra prodotto per il locale con id=<%=idlocale%>!</h1>

                    <p>${error}</p>

                    <form method="POST" action="MainController?q=register_product_action">
                        <input type="hidden" name="idlocale" value="<%=idlocale%>" /><br />
                        Nome:<input name="nome" value="pasta" /><br />
                        Categoria:<select name="categoria"><asportoonline:elenco_categorie lista_categorie="${lista_categorie}"/></select><br />
                        Descrizione:<input name="descrizione" value="Ciao ciao!" /><br />
                        Prezzo:<input name="prezzo" value="5.00" /><br />
                        Immagine:<input name="urlimmagine" value="default.jpg" /><br />
                        <input type="submit" value="REGISTRA" />
                    </form>

                    <%@ include file="/WEB-INF/common/footer.jsp"%>
                </div>
            </div>
        </div>
    </body>
</html>
